//
// Created by LinorInk on 2024/3/17.
//

#ifndef DRATSERVO_TASK_H
#define DRATSERVO_TASK_H
#include "main.h"

typedef struct task{
    uint16_t tick;              // 间隔执行的时间
    uint8_t count;
    uint32_t lastUpdateTick;    // 上一次更新的时间
    void (*pFunction)(void);        // 任务函数
    struct task* nextTask;
} taskTypedef;

uint8_t Task_remove(taskTypedef* task);
uint8_t Task_regist(taskTypedef* task,uint16_t tick, uint8_t times, void (*method)(void));
void Task_update();

#endif //DRATSERVO_TASK_H
